<template>
<div>
  <el-button type="primary" size="small" @click="dialogFormVisible = true">添加视频</el-button>

   <el-dialog title="新增视频" :visible.sync="dialogFormVisible">
        <el-form :model="form">
          <el-form-item label="标题" :label-width="formLabelWidth">
            <el-input v-model="form.title" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="视频地址" :label-width="formLabelWidth">
            <el-input v-model="form.address" autocomplete="off"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="addVideo()">确 定</el-button>
        </div>
      </el-dialog>
</div>

  
</template>

<script>
export default {
    data(){
        return{
            dialogFormVisible:false,
            form:{
                title:'',
                address:'',
            },
            formLabelWidth:30,
        }
    },
    methods:{
        addVideo(){
            this.$axios.post('/addVideo',this.form).then(successResponse=>{
                this.$message({message:"添加成功",type:'success'})
                this.dialogFormVisible = false
                this.form = {}
            })
        }
    }

}
</script>

<style>

</style>